select C1 as Code, C2 as Descriptionabc, C3 as StartTime, C4 as EndTime from CORW
where C1 not in 
(
 select handover from ESBOOKH where SERVDATE = CONVERT(datetime, '2015.01.28', 102) and WORKSHOPID = '001' and BSTATUS != 5
)
and CODAID = 'eshandovme' and V1 = '1';

 select handover from ESBOOKH where SERVDATE = CONVERT(datetime, '2015.01.28', 102) and WORKSHOPID = '001' and BSTATUS != 5


SELECT 
   '2006-04-25T15:50:59.997' AS UnconvertedText,
   CAST('2006-04-25T15:50:59.997' AS datetime) AS UsingCast,
   CONVERT(datetime, '2006-04-25T15:50:59.997', 126) , CONVERT(datetime, '2006.04.25', 102) AS UsingConvertFrom_ISO8601 ;
GO
